home *** CD-ROM | disk | FTP | other *** search
- <html>
-
- <head>
- <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
- <meta name="generator" content="Adobe GoLive 4">
- <title>Drag Floating Box Action</title>
- </head>
-
- <body bgcolor="white">
- <center>
- <font size="6">Drag Floating Box Action</font><font>
- <hr>
- </font></center>
- <p><font>
- <csactionclass name="Drag Floating Box" function="CSDrag" nsversion="4" ieversion="4"> </font></p>
- <p><font>
- <csactionparam name="layer" type="GLActionLayerParam"> </font></p>
- <p><font></csactionparam>
- </font></p>
- <p><font></csactionclass>
- </font></p>
- <p>
- <hr>
- </p>
- <p>IE Functions Script
- <script language="JavaScript1.2" src="../../GlobalScripts/IE.scpt" cyberversion="N1.2"></script>
- </p>
- <p>Drag Action Main Script<font>
- <script language="JavaScript1.2" cyberversion="N1.2"><!--
- var gCSIEDragObject = null;
- function CSSetupDrag (layerName) {
- this.x = 0; this.y = 0;
- if (IsIE()) {
- this.canDrag=true;
- this.layerObj=document.all.tags("div")[layerName];
- this.layerObj.dragObj = this;
- document.ondragstart = CSIEStartDrag;
- document.onmousedown = CSIEMouseDown;
- document.onmouseup = CSIEStopDrag;
- } else {
- this.layer=CSNSStyl(layerName);this.onmousemove=null;
- this.layer.document.theLayer=this;
- this.layer.document.captureEvents(Event.MOUSEDOWN);
- this.layer.document.onmousedown=CSNSStartDrag;
- this.layer.document.onmouseup=CSNSStopDrag;
- }
- }
- function CSNSStartDrag (ev) {
- var clickInMe = false;
- if (ev.target != this) {
- for (var i=0;i<this.images.length;i++) {
- if (this.images[i] == ev.target) { clickInMe = true; break;}
- }
- }
- else clickInMe = true;
- if (clickInMe)
- {
- this.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
- this.onmousemove=CSNSDoDrag;
- this.theLayer.x= ev.pageX;
- this.theLayer.y= ev.pageY;
- this.routeEvent(ev);
- return false;
- }
- this.onmousemove=null;this.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);
- this.routeEvent(ev);
- return true;
- }
- function CSNSStopDrag (ev) {
- this.onmousemove=null;this.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);return false;
- }
- function CSNSDoDrag (ev) {
- this.theLayer.layer.moveBy(ev.pageX-this.theLayer.x, ev.pageY-this.theLayer.y);
- this.theLayer.x = ev.pageX;
- this.theLayer.y = ev.pageY;
- this.routeEvent(ev);
- }
- function CSIEStartDrag () {
- if(gCSIEDragObject != null && (gCSIEDragObject.tagName==event.srcElement.tagName))
- event.returnValue=false;
- }
- function CSIEStopDrag () { gCSIEDragObject=null; document.onmousemove=null; }
- function CSIEMouseDown () {
- if(event.button==1) {
- dragLayer = event.srcElement;
- while (dragLayer!=null)
- {
- if ((dragLayer.dragObj == null) && (dragLayer.tagName == "DIV"))
- break;
- if (dragLayer.dragObj != null)
- break;
- dragLayer=dragLayer.parentElement;
- }
-
- if (dragLayer == null) return;
- if (dragLayer.dragObj!=null && dragLayer.dragObj.canDrag) {
- gCSIEDragObject = dragLayer;
- gCSIEDragObject.dragObj.x=event.clientX;
- gCSIEDragObject.dragObj.y=event.clientY;
- document.onmousemove = CSIEMouseMove;
- }
- }
- }
- function CSIEMouseMove () {
- gCSIEDragObject.dragObj.layerObj.style.pixelLeft+=(event.clientX-gCSIEDragObject.dragObj.x);
- gCSIEDragObject.dragObj.layerObj.style.pixelTop+=(event.clientY-gCSIEDragObject.dragObj.y);
- gCSIEDragObject.dragObj.x=event.clientX;
- gCSIEDragObject.dragObj.y=event.clientY;
- event.returnValue = false;
- event.cancelBubble = true;
- }
- var gDragArray = new Array();
- function CSDrag(action) { gDragArray[gDragArray.length] = new CSSetupDrag(action[1]); }
- // -->
- </script>
- </font></p>
- <p>
- <hr>
- </p>
- <p> </p>
- <p><font>
- <table cool width="253" height="153" border="0" cellpadding="0" cellspacing="0" gridx="16" showgridx gridy="16" showgridy bgcolor="#eeeeee">
- <tr height="1" cntrlrow>
- <td width="1" height="1"><spacer type="block" width="1" height="1"></td>
- <td width="10" height="1"><spacer type="block" width="10" height="1"></td>
- <td width="80" height="1"><spacer type="block" width="80" height="1"></td>
- <td width="160" height="1"><spacer type="block" width="160" height="1"></td>
- </tr>
- <tr height="2">
- <td width="1" height="2"><spacer type="block" width="1" height="2"></td>
- <td width="10" height="2"><spacer type="block" width="10" height="2"></td>
- <td width="80" height="2"><spacer type="block" width="80" height="2"></td>
- <td width="160" height="2"><spacer type="block" width="160" height="2"></td>
- </tr>
- <tr height="3">
- <td width="1" height="3"><spacer type="block" width="1" height="3"></td>
- <td width="10" height="3"><spacer type="block" width="10" height="3"></td>
- <td width="80" height="3"><spacer type="block" width="80" height="3"></td>
- <td width="160" height="148" colspan="1" rowspan="2" valign="top" align="left" xpos="90">
- <csactioncntrl name="layer" x="90" y="2" width="140" height="18" alignx="scale" aligny="top">
- </td>
- </tr>
- <tr height="145">
- <td width="1" height="145"><spacer type="block" width="1" height="145"></td>
- <td width="10" height="145"><spacer type="block" width="10" height="145"></td>
- <td width="80" height="145" colspan="1" rowspan="1" valign="top" align="left" xpos="10">
- <csactioncntrl type="StaticText" value="Floating Box" x="10" y="5" width="75" height="16" alignx="left" aligny="top">
- </td>
- </tr>
- </table>
- </font></p>
- <p>
- </body>
-
- </html>
-